

using System;
using System.Data.SqlClient;
using System.Data;

namespace GeneralClasses
{

    ///holds the available time and keeps track of them in the database

    #region NOTES
    /*
13 OCT 2010 - Created class, cant put it in so nothing is tested, still writing in notepadd++.
*/
    #endregion


    public class deprecated_AvailableTime
    {

        #region VARIABLES
        //==============================================================================
        //                                                                     VARIABLES
        //==============================================================================

        private int aid; // for this instance of this object
        private int personId;
        private DayOfWeek dow;
       // private int startHour; // hour
        private int endHour; // hour

        private DatabaseConnection dbc;

        #endregion
        #region PROPERTIES
        //==============================================================================
        //                                                                    PROPERTIES
        //==============================================================================


       /* public String ConnectionString
        {
            get { return dbc.ConnectionString; }
            set { dbc.ConnectionString = value; }
        }*/

        public int AID
        {
            get { return aid; }
            set { aid = value; }
        }

       /* public DateTime EndTime
        {
            get { return endHour; }
            set { endHour = value; }
        }*/

        /*public DateTime StartTime
        {
            get { return startHour; }
            set { startHour = value; }
        }*/

        public DayOfWeek DayOfWeek
        {
            get { return dow; }
            set { dow = value; }
        }

        public int PersonID
        {
            get { return personId; }
            set { personId = value; }
        }

        #endregion

        #region CONSTRUCTOR
        //==============================================================================
        //                                                                   CONSTRUCTOR
        //==============================================================================

        public deprecated_AvailableTime()
        {
            personId = -1;
            dow = new DayOfWeek();
          //  startHour = -1;
            endHour = -1;
        }

        #endregion

        #region PRIVATE

        //==============================================================================
        //                                                                       PRIVATE
        //==============================================================================

        private bool checkAvailableTimeUsed(int ptid) { return false; }


        #endregion

        #region PUBLIC
        //==============================================================================
        //                                                                        PUBLIC
        //==============================================================================

        ///pulls all of the data for this object from the database
        ///, MAKE SURE THE AID IS SET BEFOREHAND
        public void loadData()
        {
            DataTable table = dbc.query("SELECT * FROM AvailableTime A WHERE A.aid = '" + aid + "'");
            /*this.startHour = reader.GetInt32(1);  // hour, not day
            this.endHour = reader.GetInt32(2);  // hour, not day*/
        }


        public bool checkAvailableTime(DayOfWeek d, DateTime s, DateTime e) { return false; }

        public void deleteDate(int dateID)
        {
            /*if(!checkDateUsed(dateID)) {
			
            }*/

        }

        public void deprecated_addAvailableTime(DayOfWeek d, DateTime s, DateTime c)
        {
            /*if(checkDate(dateTime)==false){
                DatabaseConnection dbc = new DatabaseConnection();
                dbc.Query="INSERT INTO D (d) VALUES('" + dateTime +"')";
            } // end if*/
        } // end addDate

        public int getAvailableTimeID()
        {
            /*DatabaseConnection dbc = new DatabaseConnection();
            String sql = "SELECT did FROM D WHERE D.d = '" + dateTime + "'";
            dbc.query = sql;
            return dbc.getQuery(); // pull out the id from the result, however its formatted*/
            return -1; // for now
        }


        #endregion

    } // end class


} //end namespace